home *** CD-ROM | disk | FTP | other *** search
- Path: ix.netcom.com!netnews
- From: miker3@ix.netcom.com (Mike Rubenstein)
- Newsgroups: comp.lang.c
- Subject: Re: cpp question
- Date: Sat, 20 Jan 1996 22:14:36 GMT
- Organization: Netcom
- Message-ID: <31016894.165498560@nntp.ix.netcom.com>
- References: <4drm99$j0m@peabody.colorado.edu>
- NNTP-Posting-Host: ix-dc12-18.ix.netcom.com
- X-NETCOM-Date: Sat Jan 20 2:14:35 PM PST 1996
- X-Newsreader: Forte Agent .99c/16.141
-
- woodjr@rintintin.Colorado.EDU (WOOD JAMEY RYAN) wrote:
-
- > I have something like this:
- >
- > #define USERLEN 8
- > #define HOSTLEN 15
- >
- > char name[] = "woodjr";
- > char host[] = "really.long.hostname.com";
- > char s[100];
- >
- > sprintf(s, "%.USERLENs@%.HOSTLENs", name, host);
- >
- > And I want cpp to parse the sprintf line to:
- >
- > sprintf(s, "%.8s@%.15s", name, host);
- >
- > Which it (of course) isn't doing. Is there some syntax I
- > can use to get it to do this?
-
- sprintf(s, "%.*s@%.*s", USERLEN, name, HOSTLEN, host);
-
-
- Michael M Rubenstein
-